package com.example.supplychainbackend.mapper;

import com.example.supplychainbackend.controller.dto.project.*;
import com.example.supplychainbackend.entity.project.*;
import org.mapstruct.Builder;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;

import java.lang.annotation.Target;
import java.util.List;
import java.util.Optional;

@Mapper(componentModel = "spring",
        builder = @Builder(disableBuilder = true),
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface ProjectMapper {
    //项目计划
    List<ProjectPlanDto> toProjectPlanDtoList(List<ProjectPlanEntity> all);
    ProjectPlanDto toProjectPlanDto(ProjectPlanEntity projectPlanEntity);
    ProjectPlanEntity toProjectPlanEntity(ProjectPlanDto form);
    void updateProjectPlanEntity(ProjectPlanDto form,@MappingTarget ProjectPlanEntity projectPlanEntity);
    List<PlanDetailEntity> toPlanDetailedEntityList(List<PlanDetailDto> all);


    //项目进度
    List<ProjectProgressDto> toProjectProgressDtoList(List<ProjectProgressEntity> all);
    ProjectProgressDto toProjectProgressDto(ProjectProgressEntity entity);
    ProjectProgressEntity toProjectProgressEntity(ProjectProgressDto form);



    //项目文档
    List<ProjectDocsDto> toProjectDocsDtoList(List<ProjectDocsEntity> all);

    ProjectDocsDto toProjectDocsDto(ProjectDocsEntity projectDocsEntity);

    ProjectDocsEntity toProjectDocsEntity(ProjectDocsDto form);

    List<ProjectFolderFileDto> toProjectFolderFileDtoList(List<ProjectFolderFileEntity> fileList);

    ProjectFolderEntity toProjectFolderEntity(ProjectFolderDto form);

    ProjectNodeEntity toProjectNodeEntity(ProjectNodeDto form);
    ProjectNodeDto toProjectNodeDto(ProjectNodeEntity projectNodeEntity);
    List<ProjectNodeDto> toProjectNodeDtoList(List<ProjectNodeEntity> all);
}
